<template>
  <div
    class="select-deps-sub"
    :style="{
      width: '528px',
      height: '458px',
      overflowY: 'auto',
      overflowX: 'hidden',
    }"
  >
    <TreeDeps
      :selected="defaultkeys"
      :refresh="open"
      :show-num="true"
      type=""
      @update="handleUpdate"
    />
  </div>
</template>

<script setup>
import { ref, watch } from 'vue'
import TreeDeps from './tree-deps.vue'

// 定义 props
const props = defineProps({
  defaultkeys: {
    type: Array,
    default: () => []
  },
  open: {
    type: Boolean,
    default: false
  },
  onSelected: {
    type: Function,
    default: () => {}
  }
})

const init = ref(true)

const handleUpdate = (keys, nodes) => {
  props.onSelected(keys, nodes)
}

watch(() => props.open, (newVal) => {
})
</script>

<style scoped>
.select-deps-sub {
  width: 528px;
  height: 458px;
  overflow-y: auto;
  overflow-x: hidden;
}
</style>